Skip to content

feat(remote): push files to SSH and WSL workspaces - #700

Merged
moreih29 merged 3 commits into
developfrom
feat/remote-push-ssh
Nov 19, 2026
Merged

moreih29 merged 3 commits into
developfrom
feat/remote-push-ssh

Conversation

@moreih29

Copy link
Copy Markdown
Owner

Summary

nexus file push refused a host workspace over SSH or WSL ("file writes require a local workspace on the serving computer"). Pushes now go through the Go agent there, with the same rules as a local write.

  • New agent RPCs (agent protocol v2) write pieces to a 0600 temporary file next to the destination, in any order, then check the size and SHA-256 before renaming over it. An existing file keeps its mode; a new one gets 0666 & ~umask.
  • The workspace boundary is checked on the agent by real path, symbolic links included; -r folders are made through the same path.
  • Concurrent uploads are capped and nothing is held in memory; abort, a 2-minute idle timeout and a dropped connection remove the temporary file.
  • An older agent answers with a clear "update the remote agent" error. The new agent binary is uploaded at the next SSH start, as before.
  • Absolute paths outside the workspace (anywhere mode) stay local-only.
  • Separate commit: comments at the daemon's 0600 socket and hook.getInfo record that the same user is the trust boundary (no behavior change).

Tests

  • Go: path escape, hash mismatch cleanup, abort and disconnect cleanup, mode kept (internal/fs/write_test.go); upload race checks.
  • Bun: SSH/WSL push no longer refused, old agent error (file-writes.test.ts).
  • go vet ./..., Windows and Linux amd64 cross builds, bun run typecheck, bun run check:ci.

Manual check

Over SSH and WSL: push a single file over an existing one and a folder with -r, then check contents and modes; drop the connection mid-push and check no temporary file is left; an older agent shows the update hint.

🤖 Generated with Claude Code

@moreih29

Copy link
Copy Markdown
Owner Author

Review fixes in 2c00b87: verification gets a size-based timeout instead of the 30 s default (large pushes over slow disks), begin reaps .nexus-push-*.tmp files older than a day in the destination folder (Go agent and local path), and docs/CLI.md notes that on Windows an overwrite does not keep the old file's ACL and read-only or hidden attributes.

@moreih29
moreih29 merged commit 931657f into develop Nov 19, 2026
7 checks passed
@moreih29
moreih29 deleted the feat/remote-push-ssh branch November 19, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant